<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>MeteoCal</title>
    </h:head>
    <h:body style="font-family: sans-serif">

        <h:form>
            <h:panelGrid style="color: #3366ff" id="grid2" columns="2"  cellpadding="3" width="100%">
                <p:column style="width:85%;">
                    <div style="float: left; ">
                        <h:commandLink value="MeteoCal" style="font-size: large; font-weight: bold; padding-right: 2px" action="personal?faces-redirect=true"/>
                        <h:outputLabel value="beta" style="font-size: x-small; padding-right: 15px"/>
                        <p:outputLabel for="search" />
                        <p:autoComplete id="search" minQueryLength="3" forceSelection="true" value="#{personalBean.searched_user}" completeMethod="#{personalBean.completeSearchText}" effect="fade" emptyMessage="No users match"/>
                        <p:commandButton id="searchgo" icon="ui-icon-search"  action="#{personalBean.searchGo()}"/>
                    </div>
                </p:column>


                <p:column style="width:20%;">
                    <div style="float: right;">
                        <p:outputLabel value="#{personalBean.getLoggedUserFormatted()}" style="font-size: small; padding-right: 15px"/>
                        <p:commandButton id="notifications"  icon="ui-icon-mail-open"  action="notifications?faces-redirect=true"/>
                        <p:menuButton id="opts" value="Options" style="float: right;">
                            <p:menuitem value="#{personalBean.calendarPrivacy}" action="#{personalBean.toggleCalendarPrivacy()}" update="opts"  />
                            <p:menuitem value="Import Calendar" action="upload?faces-redirect=true"/>
                            <p:menuitem value="Export Calendar" ajax="false" action="#{personalBean.getCalendar()}" /> 
                            <p:menuitem value="Sign Out" action="#{personalBean.logout()}" icon=" ui-icon-person"/>
                        </p:menuButton>
                    </div>
                </p:column>
            </h:panelGrid>
        </h:form>
        <hr style=" background-color: #3366ff; height: 5px" />
        
        <h2>#{eventBean.name}</h2>
        
        <div style="float: left; border-right: 5px; height: 100%; width: 450px">
            <h:outputLabel value="#{eventBean.privacy}" />
            <br></br>
            <br></br>
            <img src="#{eventBean.weatherIco}"   style="width:33%;height:33%"/>
            <br></br><br></br><br></br>
            <h:outputLabel value="Forecast: #{eventBean.forecast}" />
            <br></br><br></br>
            <h:outputLabel value="#{eventBean.constraint}" />
            <br></br>
            <br></br>

            <h:form>
                <p:menu rendered="#{eventBean.menuShowable}">
                    <p:menuitem value="Accept invitation" rendered="#{eventBean.canAccept()}" action="#{eventBean.accept()}" disabled="#{eventBean.disableAccept()}"  icon="ui-icon-check" />
                    <p:menuitem value="Decline invitation" rendered="#{eventBean.canDecline()}" action="#{eventBean.decline()}"  icon="ui-icon-closethick" />
                    <p:menuitem value="Delete event" rendered="#{eventBean.canDelete()}" action="#{eventBean.deleteEvent()}"  icon="ui-icon-closethick" />
                    <p:menuitem value="Edit event" rendered="#{eventBean.canEdit()}" actionListener="#{eventBean.edit()}"  icon="ui-icon-arrowrefresh-1-w"/>
                
            </p:menu>
            </h:form>

           
        </div>
        
        <div style="float: left">
            <h:outputLabel value="Date:" style="font-style: italic; font-weight: bold; font-size: large"/>
            <br></br>
            <h:outputLabel value="#{eventBean.date}" />
            <br></br>
            <br></br>
            <h:outputLabel value="Location:" style="font-style: italic; font-weight: bold; font-size: large"/>
            <br></br>
            <h:outputLabel value="#{eventBean.location}" />
            <br></br>
            <br></br>
            <h:outputLabel value="Attendees:" style="font-style: italic; font-weight: bold; font-size: large"/>
            <br></br>
            <h:outputLabel value="#{eventBean.attendees}" />
            <br></br>
            <br></br>
            <h:outputLabel value="Maybe going:" style="font-style: italic; font-weight: bold; font-size: large"/>
            <br></br>
            <h:outputLabel value="#{eventBean.maybe}" />
            <br></br>
            <br></br>
            <h:outputLabel value="Not going:" style="font-style: italic; font-weight: bold; font-size: large"/>
            <br></br>
            <h:outputLabel value="#{eventBean.notGoing}" />
            <br></br>
            <br></br>
            <h:outputLabel value="Description:" style="font-style: italic; font-weight: bold; font-size: large"/>
            <br></br>
            <h:outputLabel value="#{eventBean.description}" />
            <br></br>
            <br></br>
            
        </div>

    </h:body>
</html>

